package ma.co.cdm.esign.workers;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RepoBatch implements Job {

	Logger logger = LoggerFactory.getLogger(RepoBatch.class);
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		
		RepoProcessing repoProcessing = (RepoProcessing) context.getJobDetail().getJobDataMap().get("repoProcessing");
		String repoWatched = (String)context.getJobDetail().getJobDataMap().get("repoWatched");
		if(repoProcessing == null)
		{
			logger.error("Un probleme est survenu lors de traitement d'un model en mode batch");
			return;
		}
		repoProcessing.checkNewFiles(repoWatched);
	}

}